<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>个人中心</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/user.css">
    <script type="text/javascript" src="../lib/js/evm.js"></script>
    <script type="text/javascript" src="../lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="../lib/js/key.js"></script>
    <script src="../lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/public.js" type="text/javascript" charset="utf-8"></script>
    <style>

    </style>
</head>

<body>
    <div class="user-bg" id="userMain">
        <div class="user-border"><img class="touxiang" src="../images/userHeader.png" alt="">
            <div class="user-name">用户名</div>
        </div>
        <div class="userintegral">当前可用积分&nbsp;&nbsp;<span style="color:#EF5645">0</span>&nbsp;&nbsp;分，立即前往兑换吧</div>
        <div class="model"></div>
        <div class="model">我的兑换</div>

        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <div class="model"></div>
        <!-- <div class="model"></div> -->
    </div>

</body>
<script>
    TV.structure('个人中心')
    var modelIndex = {
        disUser: true,
        // isVideo: true,
        isIndex: true,
        index: 0, //初始位置
        listName: 'model', //模块名称
        containerId: 'userMain' //包含模块的标签id
    }

    var data = [{
        name: '我的收藏',
        url: "../profile.html"
    },
    {
        name: '我的活动',
        url: '../profile.html'
    },
    {
        name: '我的求助',
        url: '../profile.html'
    },
    {
        name: '我的帮助',
        url: '../profile.html'
    },
    {
        name: '我的团队',
        // url: './pages/shop.html'
    },

    ]
    var access_token = $.cookie('TV_CST_TOKEN');
    var mess = {
        access_token: access_token
    }
    http(API_URL.loginURL + 'api/user/getProfile', mess, function (err, data) {
        // console.table(data.data)
        $.cookie('TV_CST_score', data.data.score);
        $('.userintegral span').html(data.data.score);
    })
    if ($.cookie('TV_CST_NAME') && $.cookie('TV_CST_NAME') != 'null') {
        // var mobile = $.cookie('TV_CST_MOBILE') == 'null' ? '暂无' : $.cookie('TV_CST_MOBILE')
        // var img = $.cookie('TV_CST_HEADIMG') || '../images/userHeader.png'
        $('.touxiang').attr('src', $.cookie("TV_CST_HEADIMG"));

        $('.user-name').html($.cookie('TV_CST_NAME'));
        console.log($.cookie('TV_CST_score'))
        // $('.userintegral span').html($.cookie('TV_CST_score'));
        // $('#userMobile').html(mobile);
    } else {
        window.history.go(-1)
    }

    function direOpt(index, directive) {
        if (directive == "up") { //上
            if (index >= 2 && index <= 5) {
                index = 0;
            }
        } else if (directive == "down") { //下
            console.log("down")
            if (index == -1) {
                index = 0;
            } else if (index == 0 || index == 1) {
                index = 2
            }
        } else if (directive == "backwards") { //左
            if (index == 1) {
                index = 0
            } else
                if (index > 2 && index <= 5) {
                    index -= 1
                }

        } else if (directive == 'forwards') { //右
            // console.log('rightright')
            if (index == 0) {
                index = 1
            } else

                if (index >= 2 && index < 5) {
                    index++;
                }
        }
        //console.log(index)
        return index;
    }


    function direEnter(index) {
        // TV.PromptMsg(getBrowser())
        // mp.stop();
        console.log(index)
        if (index == 0) {
            $.cookie('TV_CST_NAME', "", {
                path: '/'
            });
            $.cookie('TV_CST_HEADIMG', "", {
                path: '/'
            });
            $.cookie('TV_CST_MOBILE', "", {
                path: '/'
            });
            $.cookie('TV_CST_TOKEN', "", {
                path: '/'
            })
            $.cookie('TV_CST_userName', "", {
                path: '/'
            })
            window.location.href = '../index.html'
        } else if (index == 1) {
            window.location.href = './myexchange.html'
        } else if (index == 2) {
            window.location.href = './mycollection.html'
        } else if (index == 3) {
            window.location.href = './myactivity.html'
        } else if (index == 4) {
            window.location.href = './myhelp.html'
        } else if (index == 5) {
            window.location.href = './myassist.html'
        } else if (index == 6) {
            window.location.href = './myteam.html'
        }
        // if (data[index].url && index >= 0) {
        //     window.location.href = data[index].url
        // }
    }
</script>
<script type="text/javascript" src="../js/index.js"></script>

</html>